﻿<ResourceDictionary
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:auto="clr-namespace:Feedbook.Automation"
   xmlns:Feedbook_Custom="clr-namespace:Feedbook.Custom" 
   xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
   xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" mc:Ignorable="d">

    <auto:UriToImageBrushConverter x:Key="UriToImageBrushConverter"/>
    <auto:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
    <auto:FriendlyDateTimeConverter x:Key="FriendlyDateTimeConverter"/>
    <auto:NullOrEmptyToVisibilityConverter x:Key="NullOrEmptyToVisibilityConverter"/>
    <auto:ContentTypeToImageUriConverter x:Key="ContentTypeToImageUriConverter" />
    <auto:BytesToReadableSizeConverter x:Key="BytesToReadableSizeConverter"/>
    <auto:TextToInteractiveConverter x:Key="TextToInteractiveConverter"/>

    <LinearGradientBrush x:Key="ContrastBrush" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="WhiteSmoke" Offset="1"/>
        <GradientStop Color="#FFF9F9F9"/>
    </LinearGradientBrush>    
	<LinearGradientBrush  x:Key="PanelBrush" EndPoint="0.5,1" StartPoint="0.5,-0.955">
		<GradientStop Color="#00686C70" Offset="0.316"/>
        <GradientStop Color="#FF393D41" Offset="0.956"/>
        <GradientStop Color="#FF040505" Offset="0.989"/>
        <GradientStop Color="#FF131313" Offset="0.995"/>
        <GradientStop Color="#FF3C3C3C" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="BackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF292929" Offset="0.913"/>
        <GradientStop Color="#FF242323" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="SelectionBrush" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF1B1B1B" Offset="0.508"/>
        <GradientStop Color="#FF242323" Offset="0.488"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="PanelBrush2" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF686C70" Offset="0.005"/>
        <GradientStop Color="#FF17181A" Offset="0.033"/>
        <GradientStop Color="#FF232527" Offset="0.956"/>
        <GradientStop Color="#FF040505" Offset="0.989"/>
        <GradientStop Color="#FF131313" Offset="0.995"/>
        <GradientStop Color="#FF3C3C3C" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="BorderBrush" Color="#FF4E4E4E"/>
    <LinearGradientBrush x:Key="FeedTitleBrush" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF2C68FB"/>
        <GradientStop Color="#FF608DFD" Offset="0.018"/>
        <GradientStop Color="#FF3670FF" Offset="1"/>
    </LinearGradientBrush>

    <!--<Style TargetType="{x:Type TextBlock}">
        <Setter Property="RenderTransform">
            <Setter.Value>
                <TranslateTransform/>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <EventTrigger RoutedEvent="Loaded">                
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation From="-20" To="0" Duration="00:00:0.4" Storyboard.TargetProperty="RenderTransform.X"/>
                        <DoubleAnimation From="0" To="1" Duration="00:00:0.5" Storyboard.TargetProperty="Opacity"/>
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
        </Style.Triggers>
    </Style>-->

    <Style x:Key="MenuButtonStyle" TargetType="{x:Type Feedbook_Custom:LinkButton}">
        <Setter Property="Background" Value="#4CFFFFFF"/>
        <Setter Property="Foreground" Value="White"/>
        <Setter Property="Template" Value="{DynamicResource LinkButtonControlTemplate}"/>
    </Style>

    <ControlTemplate x:Key="LinkButtonControlTemplate" TargetType="{x:Type Feedbook_Custom:LinkButton}">
        <Grid x:Name="border" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Center" VerticalAlignment="Center" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Cursor="Hand">
            <Grid x:Name="rectangles" Visibility="Visible" Opacity="0.295">
                <Rectangle Stroke="{x:Null}" StrokeThickness="0" RadiusX="3" RadiusY="3">
                    <Rectangle.Fill>
                        <LinearGradientBrush EndPoint="0.5,1.056" StartPoint="0.493,-0.071">
                            <GradientStop Color="#FF47DDFB" Offset="0"/>
                            <GradientStop Color="#FF5EE3FD" Offset="1"/>
                            <GradientStop Color="#00000000" Offset="0.224"/>
                            <GradientStop Color="#00000000" Offset="0.816"/>
                            <GradientStop Offset="0.455" Color="#3066E6FF"/>
                        </LinearGradientBrush>
                    </Rectangle.Fill>
                </Rectangle>
                <Rectangle Stroke="{x:Null}" StrokeThickness="0" RadiusX="3" RadiusY="3">
                    <Rectangle.Fill>
                        <LinearGradientBrush EndPoint="-0.084,0.472" StartPoint="1.088,0.468">
                            <GradientStop Color="#FF7CEAFF"/>
                            <GradientStop Color="#FF77E9FF" Offset="1"/>
                            <GradientStop Color="#00000000" Offset="0.776"/>
                            <GradientStop Color="#00000000" Offset="0.224"/>
                            <GradientStop Offset="0.498" Color="#119EEFFF"/>
                        </LinearGradientBrush>
                    </Rectangle.Fill>
                </Rectangle>
            </Grid>
            <ContentPresenter Margin="{TemplateBinding Padding}" Height="Auto" Width="Auto" HorizontalAlignment="Center" VerticalAlignment="Center"/>
        </Grid>
        <ControlTemplate.Triggers>
            <EventTrigger RoutedEvent="UIElement.MouseEnter" SourceName="border">
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation To="1" Duration="0:0:0.3" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="rectangles"/>
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
            <EventTrigger RoutedEvent="UIElement.MouseLeave" SourceName="border">
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation To="0.3" Duration="0:0:0.2" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="rectangles"/>
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style TargetType="{x:Type ListBoxItem}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBoxItem}">
                    <ContentPresenter />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="MyListBoxItem" TargetType="{x:Type ListBoxItem}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBoxItem}">
                    <Grid Height="Auto" Width="Auto" Margin="0,0,2,0">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0.4"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="SelectedUnfocused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="rectangle" Stroke="{x:Null}" Opacity="0" StrokeThickness="0" RadiusX="2" RadiusY="2">
                            <Rectangle.Fill>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FF2389EF" Offset="0.508"/>
                                    <GradientStop Color="#FF55AAFF" Offset="0.488"/>
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <ContentPresenter d:LayoutOverrides="Width, Height" Margin="4" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Opacity" Value="0.4" TargetName="rectangle"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <ControlTemplate x:Key="TransparentButtonTemplate" TargetType="{x:Type Button}">
        <ContentPresenter x:Name="presenter"/>
    </ControlTemplate>

    <ControlTemplate x:Key="TransparentFBButtonTemplate" TargetType="{x:Type Button}">
        <ContentPresenter x:Name="presenter" TextElement.Foreground="{StaticResource ContrastBrush}" RenderTransformOrigin="0.5, 0.5" Opacity="0.795" Cursor="Hand"/>
        <ControlTemplate.Triggers>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="RenderTransform" TargetName="presenter">
                    <Setter.Value>
                        <ScaleTransform ScaleX="0.98" ScaleY="0.98"/>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsMouseOver" Value="True"/>
                    <Condition Property="IsEnabled" Value="True"/>
                </MultiTrigger.Conditions>
                <Setter Property="Opacity" Value="1" TargetName="presenter"/>
            </MultiTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <ControlTemplate x:Key="RadioButtonTemplate" TargetType="{x:Type RadioButton}">
        <Grid>
            <Border x:Name="border" Background="{DynamicResource PanelBrush}" CornerRadius="2">
                <ContentPresenter x:Name="contentPresenter" VerticalAlignment="Center" HorizontalAlignment="Center" Opacity="0.5"/>
            </Border>
        </Grid>
        <ControlTemplate.Triggers>
    		<EventTrigger RoutedEvent="FrameworkElement.Loaded"/>
    		<Trigger Property="IsMouseOver" Value="True">
    			<Setter Property="Opacity" TargetName="contentPresenter" Value="1"/>
    		</Trigger>
    		<Trigger Property="IsChecked" Value="True">
    			<Setter Property="Background" Value="{StaticResource PanelBrush2}" TargetName="border"/>
    			<Setter Property="Opacity" TargetName="contentPresenter" Value="1"/>
    		</Trigger>
    	</ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="PopupContainerStyle" TargetType="{x:Type Border}">
        <Setter Property="CornerRadius" Value="2"/>
        <Setter Property="Background" Value="{DynamicResource ContrastBrush}"/>
        <Setter Property="BorderBrush" Value="#FF9B9B9B"/>
        <Setter Property="BorderThickness" Value="1"/>
    </Style>

    <Style x:Key="WindowContainerStyle" TargetType="{x:Type Border}">
        <Setter Property="Background" Value="{DynamicResource BackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
        <Setter Property="CornerRadius" Value="1"/>
        <Setter Property="BorderThickness" Value="1"/>
    </Style>

    <Style x:Key="WindowContainerDialogStyle" BasedOn="{StaticResource WindowContainerStyle}" TargetType="{x:Type Border}">
    	<Style.Resources>
    		<Storyboard x:Key="LoadStoryboard">
    			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="{x:Null}">
    				<EasingDoubleKeyFrame KeyTime="0" Value="0.9">
    					<EasingDoubleKeyFrame.EasingFunction>
    						<BackEase EasingMode="EaseOut"/>
    					</EasingDoubleKeyFrame.EasingFunction>
    				</EasingDoubleKeyFrame>
    				<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1">
    					<EasingDoubleKeyFrame.EasingFunction>
    						<BackEase EasingMode="EaseOut"/>
    					</EasingDoubleKeyFrame.EasingFunction>
    				</EasingDoubleKeyFrame>
    			</DoubleAnimationUsingKeyFrames>
    			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="{x:Null}">
    				<EasingDoubleKeyFrame KeyTime="0" Value="0.9">
    					<EasingDoubleKeyFrame.EasingFunction>
    						<BackEase EasingMode="EaseOut"/>
    					</EasingDoubleKeyFrame.EasingFunction>
    				</EasingDoubleKeyFrame>
    				<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1">
    					<EasingDoubleKeyFrame.EasingFunction>
    						<BackEase EasingMode="EaseOut"/>
    					</EasingDoubleKeyFrame.EasingFunction>
    				</EasingDoubleKeyFrame>
    			</DoubleAnimationUsingKeyFrames>
    		</Storyboard>
    	</Style.Resources>
    
    	<Style.Triggers>
    		<EventTrigger RoutedEvent="FrameworkElement.Loaded">
    			<BeginStoryboard Storyboard="{StaticResource LoadStoryboard}"/>
    		</EventTrigger>
    	</Style.Triggers>
        <Setter Property="BorderBrush" Value="#974E4E4E"/>
        <Setter Property="CornerRadius" Value="4"/>
        <Setter Property="BorderThickness" Value="8"/>
        <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
        <Setter Property="RenderTransform">
        	<Setter.Value>
        		<TransformGroup>
        			<ScaleTransform/>
        			<SkewTransform/>
        			<RotateTransform/>
        			<TranslateTransform/>
        		</TransformGroup>
        	</Setter.Value>
        </Setter>
        <Setter Property="Margin" Value="15"/>
    </Style>

    <ControlTemplate x:Key="FBButtonTemplate" TargetType="{x:Type Button}">
        <!--<Border x:Name="border" CornerRadius="3" BorderThickness="1" RenderTransformOrigin="0.5,0.5" Cursor="Hand">
            <Border.BorderBrush>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF858585" Offset="0"/>
                    <GradientStop Color="#FF494949" Offset="1"/>
                </LinearGradientBrush>
            </Border.BorderBrush>
            <Border.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF686868" Offset="0"/>
                    <GradientStop Color="#FF373636" Offset="1"/>
                    <GradientStop Color="#FF676767" Offset="0.401"/>
                    <GradientStop Color="#FF494949" Offset="0.562"/>
                </LinearGradientBrush>
            </Border.Background>
            <ContentPresenter TextElement.Foreground="{StaticResource ContrastBrush}" Margin="{TemplateBinding Padding}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="RenderTransform" TargetName="border">
                    <Setter.Value>
                        <ScaleTransform ScaleX="0.98" ScaleY="0.98"/>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </ControlTemplate.Triggers> -->
		<ContentPresenter x:Name="ContentPresenter" Cursor="Hand" TextElement.Foreground="{StaticResource ContrastBrush}" Margin="{TemplateBinding Padding}" HorizontalAlignment="Center" VerticalAlignment="Center" Opacity="0.5"/>
		<ControlTemplate.Triggers>
			  <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Opacity" Value="1" TargetName="ContentPresenter"/>
            </Trigger>
		</ControlTemplate.Triggers>
    </ControlTemplate>
    <LinearGradientBrush x:Key="TextBoxBorder" EndPoint="0,20" MappingMode="Absolute" StartPoint="0,0">
        <GradientStop Color="#ABADB3" Offset="0.05"/>
        <GradientStop Color="#E2E3EA" Offset="0.07"/>
        <GradientStop Color="#E3E9EF" Offset="1"/>
    </LinearGradientBrush>

    <Style TargetType="{x:Type TextBox}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBox}">
                    <Border CornerRadius="3" BorderThickness="0,0,1,1" BorderBrush="#A1FFFFFF" d:LayoutOverrides="Width, Height" Background="{DynamicResource PanelBrush2}">
                        <Grid >
                            <Border Margin="{TemplateBinding Padding}" >
                                <ContentPresenter Name="toolTip" Margin="5,0,0,0" TextElement.Foreground="{StaticResource ContrastBrush}" TextElement.FontStyle="Italic" TextElement.FontSize="12" Content="{TemplateBinding ToolTip}" HorizontalAlignment="Left" VerticalAlignment="Top" Opacity="0.495" Visibility="Collapsed"/>
                            </Border>
                            <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Text" Value=""/>
                                <Condition Property="IsFocused"  Value="false"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Visibility" Value="Visible" TargetName="toolTip"/>
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="{x:Type PasswordBox}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type PasswordBox}">
                    <Border CornerRadius="3" BorderThickness="0,0,1,1" BorderBrush="#A1FFFFFF" d:LayoutOverrides="Width, Height" Background="{DynamicResource PanelBrush2}">
                        <Grid >
                            <Border Margin="{TemplateBinding Padding}" >
                                <ContentPresenter Name="toolTip" Margin="5,0,0,0" TextElement.Foreground="{StaticResource ContrastBrush}" TextElement.FontStyle="Italic" TextElement.FontSize="12" Content="{TemplateBinding ToolTip}" HorizontalAlignment="Left" VerticalAlignment="Center" Opacity="0.495"/>
                            </Border>
                            <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <GroupStyle x:Key="OutlookGroupStyle">
        <GroupStyle.ContainerStyle>
            <Style TargetType="{x:Type GroupItem}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type GroupItem}">
                            <Expander IsExpanded="True">
                                <Expander.Header>
                                    <TextBlock Foreground="{StaticResource FeedTitleBrush}" Text="{Binding Name}" FontSize="14" Margin="2,4,2,4"/>
                                </Expander.Header>
                                <ItemsPresenter />
                            </Expander>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </GroupStyle.ContainerStyle>
    </GroupStyle>
</ResourceDictionary>